import time

from hytest import *

class UI_A5101:
    ddt_cases = [
        {'name':'UI-A5101','para':''},
        {'name':'UI-A5102','para':''},
        {'name':'UI-A5201','para':''},
        {'name':'UI-A5202','para':''},
    ]

    def teststeps(self):
        # obj1 = GSTORE['thome']
        # obj2 = GSTORE['thomework_create']
        # obj3 = GSTORE['iframe_homework_create']
        # obj4 = GSTORE['thomework_created']
        # obj5 = GSTORE['question_info']
        obj6 = GSTORE['release_to_student']

        if self.name == 'UI-A5101':
            status_key = obj6.get_open_status(1)
            CHECK_POINT('班级框默认为展开状态',status_key=='true')
        if self.name == 'UI-A5201':
            status_key = obj6.get_open_status(3)
            if status_key:
                CHECK_POINT('分组框默认为隐藏状态', status_key == 'false')
            else:
                CHECK_POINT('分组框默认为隐藏状态', True)
        if self.name == 'UI-A5102':
            obj6.click_box(1)
            time.sleep(0.5)         #不可删除强制等待
            status_key = obj6.get_open_status(1)
            obj6.click_box(1)
            time.sleep(0.5)         #不可删除强制等待
            CHECK_POINT('点击后班级框为隐藏状态', status_key == 'false')


        if self.name == 'UI-A5202':
            obj6.click_box(3)
            time.sleep(0.5)         #不可删除强制等待
            status_key = obj6.get_open_status(3)
            obj6.click_box(3)
            time.sleep(0.5)         #不可删除强制等待
            CHECK_POINT('点击后分组框为展开状态', status_key == 'true')

